home *** CD-ROM | disk | FTP | other *** search
- Subject: Destroying Proxy Frames
- Sent: 7/8/96 1:27 PM
- Received: 7/8/96 12:41 PM
- From: Scott Anderson, scotta@aw.com
- Reply-To: ODF Interest, ODF-Interest@CILabs.ORG
- To: OpenDoc Development Framework Discussion List, ODF-Interest@CILabs.
-
-
- When a FW_CProxyFrame is destroyed should its fEmbeddedFrame be removed
- or should it be released if that frame has been detached (fAttached =
- FALSE)? Currently my part crashes when the fEmbeddedFrame has been
- detached and is removed in CProxyFrame's destructor...
-
- -------------------------------------------
-
- FW_CProxyFrame::~FW_CProxyFrame()
- {
- // [HLX] Need a try block
- if (fEmbeddedFrame)
- {
- Environment* ev = somGetGlobalEnvironment();
- if (FW_IsInLimbo(ev, fEmbeddedFrame)) // [HLX] do not call
- ODFrame::IsInLimbo. see FW_IsInLimbo
- {
- // If the embedded frame doesn't have fContainingFrameID as containing
- frame then
- // doesn't remove
- FW_CAcquiredODFrame embeddingFrame =
- fEmbeddedFrame->AcquireContainingFrame(ev);
- if (embeddingFrame == NULL || embeddingFrame->GetID(ev) ==
- fContainingFrameID)
- fEmbeddedFrame->Remove(ev);
- else
- fEmbeddedFrame->Release(ev);
- }
- else
- fEmbeddedFrame->Release(ev);
- }
- }
-
- -------------------------------------------
-
- When I check if the proxy has been detached and release the frame instead...
-
- -------------------------------------------
-
- FW_CProxyFrame::~FW_CProxyFrame()
- {
- // [HLX] Need a try block
- if (fEmbeddedFrame)
- {
- Environment* ev = somGetGlobalEnvironment();
- if (fAttached && FW_IsInLimbo(ev, fEmbeddedFrame)) // <<------ Changed
- Line --------
- {
- // If the embedded frame doesn't have fContainingFrameID as containing
- frame then
- // doesn't remove
- FW_CAcquiredODFrame embeddingFrame =
- fEmbeddedFrame->AcquireContainingFrame(ev);
- if (embeddingFrame == NULL || embeddingFrame->GetID(ev) ==
- fContainingFrameID)
- fEmbeddedFrame->Remove(ev);
- else
- fEmbeddedFrame->Release(ev);
- }
- else
- fEmbeddedFrame->Release(ev);
- }
- }
-
- -------------------------------------------
-
- ..everything works fine.
-
- What should be happening here?
-
- -Scott
-